package com.example.spotbugs;

import java.util.List;

public class Test {

    /**
     * 1.不良写法 Practice
     */
    public void TestPractice() {
        System.out.println("-------------------");
    }

    /**
     * 2.潜在的性能问题 Performance
     */
    public String testPerformance(List<String> array) {
        String str = "";
        for (int i = 0; i < array.size(); i++) {
            str = str + array.get(i);
        }
        return str;
    }

    /**
     * 3.代码漏洞 DodgyCode
     */
    public void testDodgyCode(int i) {
        switch (i) {
            case 1:
                System.out.println(1);
                break;
            case 2:
                System.out.println(2);
                break;
        }
    }

}
